﻿using System;
using System.Collections.Generic;
using System.Text;

namespace KFM.Services.Base
{
    public class KFMResult
    {
        public int code { get; set; }   
        public  string message { get; set; }    
        public object data { get; set; }
        public KFMResult successResult(string messege,object data = null)
        {
            this.code = ResultEnum.success.GetHashCode();
            this.message = messege;
            this.data = data;
            return this;
        }
        public KFMResult errorResult(string messege, object data = null)
        {
            this.code = ResultEnum.error.GetHashCode();
            this.message = messege;
            this.data = data;
            return this;
        }
        public KFMResult warnResult(string messege, object data = null)
        {
            this.code = ResultEnum.warn.GetHashCode();
            this.message = messege;
            this.data = data;
            return this;
        }
    }
    public enum ResultEnum
    {
        error = -1,
        warn = 0,
        success = 1
    }
}
